package com.example.hasee.zhcd.Adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.hasee.zhcd.R;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created by hasee on 2017/9/13.
 */

public class SfygDetailAdapter extends BaseAdapter {
    private ArrayList<HashMap<String, String>> list;
    private LayoutInflater itemInflater;
    private Context context;
    private Holder holder;

    public SfygDetailAdapter(Context context, ArrayList<HashMap<String, String>> list) {
        this.context = context;
        this.list = list;
        this.itemInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            holder = new Holder();
            convertView = itemInflater.inflate(R.layout.sfyg_detail_item, null);
            holder.note = (TextView) convertView.findViewById(R.id.note);
            convertView.setTag(holder);
        } else {
            holder = (Holder) convertView.getTag();
        }
        holder.note.setText((String) list.get(position).get("fnote"));
        return convertView;
    }

    class Holder {
        private TextView note;

    }
}
